<?php
use application\Comm\Func;

$pager = new \application\Comm\Pager($page);
?>
<link rel="stylesheet" href="<?php echo Func::staticUrl('css/decorate.css') ?>">
<div class="decorateList clearfix">
    <div class="decorateList_tit">
        <div class="wrap">
            <div class="decorateList_choose">
                <a href="<?php echo Func::createUrl('decorate/index')?>">装修频道  ></a>
                <a href="javascript:;"><?php echo $tag_name?>  ></a>

            </div>
        </div>
    </div>
    <div class="decorateList_body wrap">
        <div class="dec_article fl">
            <ul>
                <?php if (!empty($data)) {
                    foreach ($data as $k => $v) {
                        ?>
                        <li>
                            <div class="article_tit">
                                <div class="article_tits fl">
                                    <i></i>
                                    <a target="_blank"
                                       href="<?php echo $v['url']?>"><?php echo $v['name'] ?></a>
                                </div>
                                <div class="article_zan fr" data-id="<?php echo $v['id']?>">
                                    <div>
                                        <i class="zan"></i>
                                        <span><?php echo $v['like_num']?></span>
                                    </div>
                                </div>
                            </div>
                            <p class="wz">
                                <?php echo $v['description'] ?><a href="<?php echo $v['url']?>" target="_blank">[详情]</a>
                            </p>
                            <div class="keyword">
                                <?php if (!empty($v['tag_list'])) { ?>
                                    关键词：<?php foreach ($v['tag_list'] as $key => $value) { ?>
                                        <a href="<?php echo Func::createUrl('decorate/tag', ['tid' => $value['id']]) ?>"><?php echo $value['name'] ?></a>

                                    <?php }
                                } ?>
                            </div>
                        </li>
                    <?php }
                } ?>
            </ul>
            <div class="products_sel">
                <div class="ik">
                    <?php
                    echo $pager->show('product2');
                    ?>
                </div>
            </div>
        </div>
        <div class="dec_description fr">
            <div class="make_quote">
                <!--报价报名框-->
                <?= $this->renderPartial('common/apply_quote'); ?>
            </div>
            <?php $this->renderPartial('decorate/hot_list', ['hot_list' => $hot_list,]); ?>

            <div class="hot_erweima">
                <img src="<?php echo Func::staticUrl('images/decorate/erweima.jpg') ?>">
            </div>
        </div>
    </div>
</div>
<script>
    $(".article_zan").click(function(){
        $like = $(this).find('span');
        $val = $like.text();
        $.post("<?php echo Func::createUrl('decorate/taglike')?>", {id: $(this).attr("data-id")},
            function () {
                $like.text(parseInt($val)+parseInt(1))
            });
    });
</script>